Skip to content

Перевод приложения с Fragment/View на Compose#15

Open
malinaalina wants to merge 1 commit into
Otus-Android:masterfrom
malinaalina:master
Open

Перевод приложения с Fragment/View на Compose#15
malinaalina wants to merge 1 commit into
Otus-Android:masterfrom
malinaalina:master

Conversation

@malinaalina

Copy link
Copy Markdown

Приложение переведено с Fragment/View на Compose, заменена навигация
app_release-classes.txt
Screenshot_20260312_224304
Screenshot_20260312_224312
Screenshot_20260312_224447

@Composable
fun DiscountBadge(
modifier: Modifier = Modifier,
discountText: String,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по конвенции, аргументы без дефолтного значения должны идти первыми

}
val context = LocalContext.current
val factory = component.getFactory()
val viewModel: DetailsViewModel = viewModel(factory = factory)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше вьюмодель создать снаружи экрана (например в composable) и передать готовую

@Composable
fun ProductsContent(
isLoading: Boolean,
products: List<ProductState>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в иделе List нужно заменить на ImmutableList из kotlinx.collections.immutable для стабильности аргументов

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants